// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const pluralizationMap = {
  Alert: 'Alerts',
  AnchorNavigation: 'AnchorNavigations',
  Annotation: 'Annotations',
  AppLayout: 'AppLayouts',
  AreaChart: 'AreaCharts',
  AttributeEditor: 'AttributeEditors',
  Autosuggest: 'Autosuggests',
  Badge: 'Badges',
  BarChart: 'BarCharts',
  Box: 'Boxes',
  BreadcrumbGroup: 'BreadcrumbGroups',
  Button: 'Buttons',
  ButtonDropdown: 'ButtonDropdowns',
  ButtonGroup: 'ButtonGroups',
  Calendar: 'Calendars',
  Cards: 'Cards',
  Checkbox: 'Checkboxes',
  CodeEditor: 'CodeEditors',
  CollectionPreferences: 'CollectionPreferences',
  ColumnLayout: 'ColumnLayouts',
  Container: 'Containers',
  ContentLayout: 'ContentLayouts',
  CopyToClipboard: 'CopyToClipboards',
  DateInput: 'DateInputs',
  DatePicker: 'DatePickers',
  DateRangePicker: 'DateRangePickers',
  Drawer: 'Drawers',
  ExpandableSection: 'ExpandableSections',
  FileDropzone: 'FileDropzones',
  FileInput: 'FileInputs',
  FileTokenGroup: 'FileTokenGroups',
  FileUpload: 'FileUploads',
  Flashbar: 'Flashbars',
  Form: 'Forms',
  FormField: 'FormFields',
  Grid: 'Grids',
  Header: 'Headers',
  HelpPanel: 'HelpPanels',
  Hotspot: 'Hotspots',
  Icon: 'Icons',
  IconProvider: 'IconProviders',
  Input: 'Inputs',
  KeyValuePairs: 'KeyValuePairs',
  LineChart: 'LineCharts',
  Link: 'Links',
  List: 'Lists',
  LiveRegion: 'LiveRegions',
  MixedLineBarChart: 'MixedLineBarCharts',
  Modal: 'Modals',
  Multiselect: 'Multiselects',
  NavigableGroup: 'NavigableGroups',
  Pagination: 'Paginations',
  AppLayoutToolbar: 'AppLayoutToolbars',
  PieChart: 'PieCharts',
  Popover: 'Popovers',
  ProgressBar: 'ProgressBars',
  PromptInput: 'PromptInputs',
  PropertyFilter: 'PropertyFilters',
  RadioButton: 'RadioButtons',
  RadioGroup: 'RadioGroups',
  S3ResourceSelector: 'S3ResourceSelectors',
  SegmentedControl: 'SegmentedControls',
  Select: 'Selects',
  SideNavigation: 'SideNavigations',
  Slider: 'Sliders',
  SpaceBetween: 'SpaceBetweens',
  Spinner: 'Spinners',
  SplitPanel: 'SplitPanels',
  StatusIndicator: 'StatusIndicators',
  Steps: 'Steps',
  Table: 'Tables',
  Tabs: 'Tabs',
  TagEditor: 'TagEditors',
  TextContent: 'TextContents',
  TextFilter: 'TextFilters',
  Textarea: 'Textareas',
  Tiles: 'Tiles',
  TimeInput: 'TimeInputs',
  Toggle: 'Toggles',
  ToggleButton: 'ToggleButtons',
  Token: 'Tokens',
  TokenGroup: 'TokenGroups',
  TopNavigation: 'TopNavigations',
  TreeView: 'TreeViews',
  TutorialPanel: 'TutorialPanels',
  Wizard: 'Wizards',
};

function pluralizeComponentName(componentName) {
  if (!(componentName in pluralizationMap)) {
    throw new Error(`Could not find the plural case for ${componentName}.`);
  }

  return pluralizationMap[componentName];
}

module.exports = { pluralizeComponentName };
